﻿using System;
using System.Collections.Generic;
using System.Linq;

using FluentNHibernate.Mapping;

namespace mForum.Infrastructure.NHibernate.Mappings
{
    using mForum.Domain.DomainObject;

    public class UserMap : ClassMap<User>
    {
        public UserMap()
        {
            Id(p => p.Id).GeneratedBy.Guid();

            Map(p => p.Username).Not.Nullable().Length(256);
            Map(p => p.Password).Not.Nullable().Length(256);
            Map(p => p.Email).Not.Nullable().Length(256);
            Map(p => p.PasswordQuestion).Not.Nullable().Length(256);
            Map(p => p.PasswordAnswer).Not.Nullable().Length(256);
            Map(p => p.isLockedOut).Not.Nullable();
            Map(p => p.LastLockedOutDate).Nullable();
            Map(p => p.LastActivityDate).Not.Nullable();
            Map(p => p.LastLoginDate).Not.Nullable();
            Map(p => p.CreatedDate).Not.Nullable();

            Table("[User]");
        }
    }
}
